package com.itheima.dao;

import com.itheima.domain.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;

public interface UserDao {
    @Select("select * from user")
    List<User> findAll();


    @Select("select * from user where id=#{id}")
    User findById(Integer id);

    @Update("update user set username=#{username},password=#{password},age=#{age},email=#{email},sex=#{sex} where id=#{id}")
    void update(User user);
    @Insert("insert into user(age,userName,password,email,sex)values(#{age},#{userName},#{password},#{email},#{sex})")
    void save(User user);
}